Working with Latitude and Longitude in Tableau
1. Introduction to Latitude and Longitude
Latitude and Longitude are geographic coordinates used to identify the precise position of a location on Earth. In Tableau, these coordinates help users plot cities, stores, customers, delivery destinations, airports, and other locations on maps.
Latitude represents the north-south position of a location, while Longitude represents its east-west position. When a dataset contains valid latitude and longitude values, Tableau can use them to create map visualizations without relying entirely on location names or built-in geocoding.
For example, a business may store the latitude and longitude of every retail store. Tableau can use these coordinates to display each store on a map and visualize sales, profit, customer visits, or delivery performance by location.
Learning Objectives
- Understand latitude and longitude coordinates.
- Learn the difference between latitude and longitude.
- Understand decimal-degree coordinate formats.
- Prepare coordinate fields for Tableau.
- Assign the correct geographic roles to coordinate fields.
- Create maps using custom latitude and longitude values.
- Customize marks using size, color, labels, and tooltips.
- Troubleshoot coordinate-related mapping problems.
2. What Is Latitude?
Latitude measures the angular distance of a location north or south of the Equator. The Equator represents 0 degrees latitude.
- Latitude values range from 0° to 90° north.
- Latitude values also range from 0° to 90° south.
- Positive latitude values generally represent locations north of the Equator.
- Negative latitude values generally represent locations south of the Equator.
Examples
| Location |
Approximate Latitude |
Position |
| Delhi, India |
28.6139 |
North of the Equator |
| Mumbai, India |
19.0760 |
North of the Equator |
| Sydney, Australia |
-33.8688 |
South of the Equator |
| Singapore |
1.3521 |
North of the Equator |
Remember: Latitude tells you how far north or south a location is from the Equator.
3. What Is Longitude?
Longitude measures the angular distance of a location east or west of the Prime Meridian. The Prime Meridian represents 0 degrees longitude.
- Longitude values range from 0° to 180° east.
- Longitude values also range from 0° to 180° west.
- Positive longitude values generally represent locations east of the Prime Meridian.
- Negative longitude values generally represent locations west of the Prime Meridian.
Examples
| Location |
Approximate Longitude |
Position |
| Mumbai, India |
72.8777 |
East of the Prime Meridian |
| Delhi, India |
77.2090 |
East of the Prime Meridian |
| New York City, USA |
-74.0060 |
West of the Prime Meridian |
| Sydney, Australia |
151.2093 |
East of the Prime Meridian |
Remember: Longitude tells you how far east or west a location is from the Prime Meridian.
4. Difference Between Latitude and Longitude
| Feature |
Latitude |
Longitude |
| Measures |
North-south position |
East-west position |
| Reference line |
Equator |
Prime Meridian |
| Range |
-90° to +90° |
-180° to +180° |
| Positive values |
North of the Equator |
East of the Prime Meridian |
| Negative values |
South of the Equator |
West of the Prime Meridian |
| Tableau geographic role |
Latitude |
Longitude |
| Typical shelf placement |
Rows |
Columns |
Both coordinates are needed to identify a geographic position accurately. Latitude alone identifies a north-south position, while longitude alone identifies an east-west position. Together, they specify a point on Earth's surface.
5. Understanding Decimal Degrees
Tableau supports latitude and longitude coordinates expressed in decimal degrees. Decimal degrees represent a geographic coordinate using a single decimal number instead of separate degrees, minutes, and seconds.
Example
Latitude: 19.0760
Longitude: 72.8777
These coordinates identify an approximate point in Mumbai, India. The exact position depends on the particular location being represented.
Decimal Degrees vs. Degrees, Minutes, and Seconds
| Format |
Example Latitude |
Description |
| Decimal degrees |
19.0760 |
Uses a decimal number. |
| Degrees, minutes, seconds |
19° 4' 33.6" N |
Uses degrees, minutes, and seconds. |
If your data contains degrees, minutes, and seconds, convert the values to decimal degrees before using them as Tableau coordinate fields.
Conversion Formula
Decimal Degrees =
Degrees + (Minutes / 60) + (Seconds / 3600)
For southern latitudes or western longitudes, use a negative result. Apply the appropriate sign according to the hemisphere.
6. Why Are Latitude and Longitude Important in Tableau?
Latitude and longitude allow Tableau to plot precise point locations, especially when place names alone are insufficient or when a dataset contains coordinates for individual records.
- Store mapping: Display individual retail branches.
- Customer mapping: Analyze the geographical distribution of customers.
- Delivery analysis: Visualize delivery destinations.
- Transportation: Plot vehicle locations or transport facilities.
- Healthcare: Display clinics, hospitals, and service areas.
- Sales analysis: Compare performance across precisely located outlets.
- Event analysis: Plot locations where events or incidents occurred.
Coordinates are especially useful when different locations share the same name or when the data contains locations that Tableau's built-in geocoding does not recognize.
7. Preparing Latitude and Longitude Data
Before connecting coordinate data to Tableau, verify the structure and quality of the fields. Incorrect data types, missing coordinates, or reversed coordinate values can cause mapping problems.
Recommended Dataset Structure
| Store ID |
City |
Latitude |
Longitude |
Sales |
| S001 |
Mumbai |
19.0760 |
72.8777 |
150000 |
| S002 |
Delhi |
28.6139 |
77.2090 |
125000 |
| S003 |
Bengaluru |
12.9716 |
77.5946 |
110000 |
| S004 |
Chennai |
13.0827 |
80.2707 |
90000 |
Data Preparation Checklist
- Ensure Latitude and Longitude contain numeric values.
- Use decimal degrees where possible.
- Remove or investigate missing coordinates.
- Check that latitude values fall between -90 and +90.
- Check that longitude values fall between -180 and +180.
- Confirm that latitude and longitude values belong to the same record.
- Use a unique identifier when each location must appear as a separate mark.
- Check for duplicate records and repeated coordinates.
Latitude and longitude values within their valid numerical ranges are not necessarily correct. Compare coordinates with a trusted source or map when location accuracy is important.
8. Assigning Geographic Roles to Coordinate Fields
Tableau needs to know which field represents latitude and which represents longitude. Assigning the correct geographic roles allows Tableau to interpret custom coordinate fields correctly.
Steps to Assign Geographic Roles
- Connect Tableau to the dataset.
- Locate the Latitude field in the Data pane.
- Right-click Latitude.
- Select Geographic Role.
- Choose Latitude.
- Locate the Longitude field.
- Right-click Longitude.
- Select Geographic Role and choose Longitude.
- Confirm that both fields have suitable numeric data types.
Tableau may recognize coordinate fields automatically. If the roles are already assigned correctly, you do not need to assign them again.
9. Understanding Generated and Custom Coordinates
Tableau can use two types of coordinate fields: generated coordinates based on recognized geographic fields and custom coordinates supplied in the dataset.
A. Generated Latitude and Longitude
When Tableau recognizes geographic fields such as Country, State, or City, it can create Latitude (generated) and Longitude (generated) fields. These fields provide positions based on Tableau's geographic information.
For example, adding a recognized City field to a worksheet may cause Tableau to place generated longitude and latitude fields on the Columns and Rows shelves.
B. Custom Latitude and Longitude
Custom coordinates are latitude and longitude values that already exist in your dataset. They are useful for plotting specific stores, customers, facilities, or other locations.
| Feature |
Generated Coordinates |
Custom Coordinates |
| Source |
Tableau's geographic information for recognized locations. |
Values supplied by your dataset. |
| Typical use |
Mapping recognized cities, states, and countries. |
Mapping specific points or custom locations. |
| Accuracy considerations |
Depends on the matched geographic location and its stored position. |
Depends on the quality and precision of the source coordinates. |
| Configuration |
Often generated automatically when geographic fields are used. |
Requires valid coordinate fields with appropriate geographic roles. |
10. Creating a Map Using Custom Latitude and Longitude
This method is useful when your dataset already contains coordinates for individual locations.
Step-by-Step Process
- Open Tableau Desktop.
- Connect to an Excel file, CSV file, database, or another supported data source containing latitude and longitude fields.
- Open a new worksheet.
- Assign the Latitude geographic role to the latitude field.
- Assign the Longitude geographic role to the longitude field.
- Drag Longitude to the Columns shelf.
- Drag Latitude to the Rows shelf.
- Drag a unique identifier, such as Store ID, to Detail on the Marks card if you want a separate mark for each store.
- Verify that the marks appear at the correct geographic locations.
- Add fields such as Sales or Store Type to Color, Size, or Tooltip.
Process Flow
Connect to the Dataset
↓
Check Coordinate Values
↓
Assign Latitude and Longitude Roles
↓
Longitude → Columns
Latitude → Rows
↓
Add a Location Identifier to Detail
↓
Customize the Map
Important: Place Longitude on Columns and Latitude on Rows. This is the standard shelf arrangement for coordinate-based maps in Tableau.
11. Creating a Store Location Map
Suppose a retail business wants to display its stores on a map and compare their sales performance.
Sample Data
StoreID,City,Latitude,Longitude,Sales
S001,Mumbai,19.0760,72.8777,150000
S002,Delhi,28.6139,77.2090,125000
S003,Bengaluru,12.9716,77.5946,110000
S004,Chennai,13.0827,80.2707,90000
S005,Hyderabad,17.3850,78.4867,105000
Procedure
- Import the sample data into Tableau.
- Set the correct geographic roles for Latitude and Longitude.
- Drag Longitude to Columns.
- Drag Latitude to Rows.
- Drag StoreID to Detail to create a separate mark for each store.
- Choose Circle as the mark type if necessary.
- Drag Sales to Size to show differences in store sales.
- Drag City to Tooltip or Label.
- Optionally drag Sales to Color to add another visual encoding.
- Review the map for incorrect or overlapping locations.
Expected Result
The map displays individual store locations. Larger circles can represent stores with higher sales, while smaller circles represent stores with lower sales. Tooltips can display each store's city, ID, and sales value.
12. Understanding the Rows and Columns Shelves
Tableau uses the Rows and Columns shelves to position coordinate-based marks on the map.
| Shelf |
Coordinate Field |
Purpose |
| Columns |
Longitude |
Positions marks horizontally according to east-west location. |
| Rows |
Latitude |
Positions marks vertically according to north-south location. |
When coordinates are placed on the appropriate shelves, Tableau uses the geographic values to determine where the marks appear on the map. The map projection can affect how distances and shapes look visually, so screen distances should not be treated as exact real-world distances.
13. Understanding Aggregation of Coordinates
Tableau often treats numeric latitude and longitude fields as measures and aggregates them. If Tableau averages the coordinates across multiple records, several locations may be represented by a single point.
Example
A dataset contains the coordinates of 100 customer deliveries. If the view aggregates latitude and longitude without separating individual records, Tableau may show a single mark at an aggregated position rather than 100 individual delivery points.
How to Display Individual Locations
- Place the coordinate fields on the Rows and Columns shelves.
- Drag a unique identifier, such as Delivery ID or Store ID, to Detail.
- Check whether Tableau now displays the expected number of marks.
- Verify that each identifier corresponds to the correct coordinate record.
Another option in suitable cases is to convert coordinate fields from measures to dimensions. However, use a unique identifier and a suitable level of detail to control individual marks reliably.
14. Customizing Maps with Size and Color
After plotting coordinates, you can use visual properties to communicate business information.
Using Size
Drag a quantitative measure such as Sales, Revenue, or Customer Count to Size. Larger marks represent larger values according to the selected size encoding.
Using Color
Drag a measure such as Profit to Color to show a quantitative scale. You can also use a dimension such as Store Type to assign colors to different categories.
Using Labels
Drag fields such as City or Store ID to Label when viewers need to identify locations directly on the map.
Using Tooltips
Drag fields such as Store ID, City, Sales, and Profit to Tooltip so users can view additional information when hovering over marks.
| Marks Card Option |
Example |
| Size |
Sales by store |
| Color |
Profit by store |
| Label |
City or Store ID |
| Detail |
Delivery ID or Store ID |
| Tooltip |
City, Sales, Profit, and Store Type |
15. Creating a Density Map Using Coordinates
A density map displays the concentration of geographic points using color intensity. It is useful when many points are close together and the main question concerns where locations are concentrated rather than the value of each individual point.
Example Use Cases
- Customer concentration by location.
- Delivery pickup and drop-off concentration.
- Incident locations across a city.
- High concentrations of store visits.
Basic Procedure
- Create a map using the coordinate fields.
- Add a unique identifier to Detail if individual records need to be represented.
- Open the Marks type menu.
- Select Density if it is available for the current view.
- Adjust the density appearance and color settings.
- Review the resulting concentration patterns.
A density map does not replace precise point-level analysis. It emphasizes concentration, so use a symbol map when individual locations and their specific values are more important.
16. Using Coordinates with Geographic Names
A dataset may contain both coordinate fields and descriptive geographic fields such as City, State, and Country. Using both can improve readability and help validate location data.
Example Dataset
| City |
State |
Latitude |
Longitude |
| Mumbai |
Maharashtra |
19.0760 |
72.8777 |
| Delhi |
Delhi |
28.6139 |
77.2090 |
| Bengaluru |
Karnataka |
12.9716 |
77.5946 |
Coordinates determine the plotted positions, while names and administrative areas can be used in labels, tooltips, filters, and analytical hierarchies.
Benefits
- Improves the readability of maps.
- Helps users identify individual locations.
- Supports filtering and grouping by geographic names.
- Provides additional context for validating coordinate records.
- Helps detect mismatches between location names and coordinates.
17. Common Latitude and Longitude Errors
| Problem |
Possible Cause |
Solution |
| Map points appear in the wrong place |
Latitude and longitude are reversed or incorrect. |
Verify field assignments and compare coordinates against a trusted source. |
| No map appears |
Coordinate fields are not configured correctly. |
Assign the Latitude and Longitude geographic roles and place them on the appropriate shelves. |
| Only one point appears |
Coordinates are aggregated across many records. |
Add a unique record identifier to Detail or adjust the level of detail. |
| Points appear far from the expected location |
Incorrect signs, coordinate formats, or data-entry errors. |
Validate decimal-degree format and hemisphere signs. |
| Some records do not appear |
Missing, null, or invalid coordinate values. |
Clean the data and investigate missing coordinates. |
| All points overlap |
Repeated coordinates or multiple records for one location. |
Check for duplicates and determine whether separate marks are required. |
| Map has confusing labels |
Too many labels or overlapping points. |
Show fewer labels and use tooltips. |
| Coordinates display as text |
The fields have a string data type. |
Convert valid coordinate values to a numeric decimal type. |
| Location names and points do not match |
Coordinates were joined to the wrong records. |
Check join keys, identifiers, and source data quality. |
18. Best Practices for Latitude and Longitude
- Use decimal degrees for coordinate-based mapping.
- Keep latitude and longitude in separate numeric fields.
- Verify the correct geographic role for each field.
- Always place Longitude on Columns and Latitude on Rows.
- Check coordinate ranges and signs.
- Use a unique identifier when individual records should appear separately.
- Validate coordinates against a reliable reference when accuracy matters.
- Check for duplicate, missing, or incorrect records.
- Use color and size consistently and include a legend when appropriate.
- Avoid excessive labels when many points are displayed.
- Use density maps for concentration analysis and symbol maps for individual point comparisons.
- Consider privacy and access controls when mapping sensitive customer or personal location data.
19. Practical Project: Customer Location Analysis
Project Objective: Create a Tableau map that displays customer locations and compares customer-related business metrics.
Required Fields
- Customer ID
- Customer City
- Latitude
- Longitude
- Total Sales
- Customer Segment
Project Steps
- Import the customer dataset into Tableau.
- Verify that the latitude and longitude values are valid numeric coordinates.
- Assign the appropriate geographic roles.
- Place Longitude on Columns and Latitude on Rows.
- Drag Customer ID to Detail if each customer needs a separate mark.
- Drag Total Sales to Size.
- Drag Customer Segment to Color.
- Drag Customer City and Total Sales to Tooltip.
- Inspect the map for missing coordinates and overlapping points.
- Apply filters for customer segment or sales range if required.
- Build a dashboard with the map and a summary chart of sales by segment.
Questions to Answer
- Where are customers geographically concentrated?
- Which locations have higher total sales?
- Which customer segments are prominent in different areas?
- Are some locations represented by duplicate coordinates?
- Would a density map communicate the distribution more clearly?
Expected Learning Outcome
After completing this project, you should be able to prepare coordinate data, create a map using custom latitude and longitude, control the level of detail, customize marks, and analyze geographical patterns.
20. Interview Questions and Answers
Q1. What is latitude?
Latitude measures the angular position of a location north or south of the Equator.
Q2. What is longitude?
Longitude measures the angular position of a location east or west of the Prime Meridian.
Q3. What are the valid latitude and longitude ranges?
Latitude ranges from -90 to +90 degrees, and longitude ranges from -180 to +180 degrees.
Q4. Why are latitude and longitude important in Tableau?
They allow Tableau to plot precise geographic positions and create maps from coordinate-based datasets.
Q5. How do you create a map using custom coordinates?
Assign the correct geographic roles, place Longitude on Columns, place Latitude on Rows, and add a suitable dimension to Detail.
Q6. What is the difference between generated and custom coordinates?
Generated coordinates are provided by Tableau based on recognized geographic fields. Custom coordinates come from the user's dataset.
Q7. Why should Longitude be placed on Columns?
Longitude represents the east-west position and is conventionally placed on the horizontal axis of Tableau's map view.
Q8. Why should Latitude be placed on Rows?
Latitude represents the north-south position and is conventionally placed on the vertical axis of Tableau's map view.
Q9. Why might Tableau show only one point for many coordinate records?
The coordinates may be aggregated. Adding a unique identifier to Detail can help create separate marks for individual records.
Q10. What is decimal-degree format?
It represents a geographic coordinate as a single decimal number, such as 19.0760.
Q11. What happens if latitude and longitude are reversed?
Points may appear in incorrect locations or outside the expected region.
Q12. How can you represent sales on a coordinate map?
Drag Sales to Size or Color on the Marks card.
Q13. What is a density map?
A density map uses color intensity to show the concentration of points across geographic space.
Q14. Why should coordinate data be validated?
Incorrect signs, reversed fields, missing values, and inaccurate coordinates can produce misleading map visualizations.
Q15. Can Tableau map locations without city names?
Yes. Valid latitude and longitude coordinates can be used to plot locations without relying on recognized city names.
21. Quick Revision Checklist
- Understand latitude and longitude.
- Know the Equator and Prime Meridian.
- Remember the valid coordinate ranges.
- Understand decimal-degree format.
- Prepare numeric coordinate fields.
- Assign Latitude and Longitude geographic roles.
- Place Longitude on Columns and Latitude on Rows.
- Add a unique identifier to Detail when necessary.
- Understand generated versus custom coordinates.
- Use Size, Color, Label, and Tooltip effectively.
- Validate coordinates and check for duplicate records.
- Understand when to use symbol maps and density maps.
22. Conclusion
Working with Latitude and Longitude in Tableau allows users to create map visualizations from precise geographic coordinates. By preparing coordinate data correctly, assigning the appropriate geographic roles, placing longitude on Columns and latitude on Rows, and controlling the level of detail, users can map stores, customers, deliveries, and other locations. Combining coordinates with measures such as Sales and Profit makes it possible to create informative geographic analyses and interactive dashboards.
23. Additional Learning Resources